//https://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6?tpId=13&tqId=23283&ru=/exam/oj/ta&qru=/ta/coding-interviews/question-ranking&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D1%26tpId%3D13%26type%3D13
//动态规划：f(n)=f(n-1)+f(n-2)

class Solution1 {
public:
    int rectCover(int number) {
        int res = 0;
        if (number == 0) return 0;
        if (number == 1 || number == 2) return number ;

        int last_f1 = 2;
        int last_f2 = 1;
        for(int i=3;i<=number;++i) {
            res = last_f1 + last_f2;
            last_f2 = last_f1;
            last_f1 = res;
        }
        return  res;
    }
};